package test;

import java.beans.BeanInfo;
import java.beans.PropertyDescriptor;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.Map;

import test.pojo.Contact;
import test.pojo.MySQLShowProcessList;
import test.pojo.Users;
 

import com.javabloger.orm.SimpleDataSource;
import com.javabloger.orm.common.ORMappingTools;

		public class ORMTestCase {
		
			/**
			 * @param args
			 * @throws SQLException 
			 */
			
		 
			@SuppressWarnings("unchecked")
			public static void main(String[] args) throws Exception {
			  

				
				/*
				Users  user= new Users();
				JDBCUtils  utils= new JDBCTemplateUtils();
				
				String dirver="com.mysql.jdbc.Driver" ;
				String url="jdbc:mysql://127.0.0.1/smbcrm";
				String username="root";
				String password="123456";
				
				 Connection  conn= new SimpleDataSource(
						 dirver, url,
						 username, password).getConnection();
			
				 
			
				
				Contact  contact= new Contact();
				contact.setName("asdasdasd");
				contact.setCreatetime("2009-00-00");
				
//				utils.startTransaction(conn);
//				utils.addBatchObjects(conn, new Object[]{ user,contact });
				
//				utils.deleteByPrimaryKey(conn, Users.class, "id", 115);
//				utils.deleteObjectsByPrimaryKeys	(conn,   Users.class  , "id", new Object[]{"114",113});
		   		
		// 			utils.addObject(conn, user);
		  			
				
				List<Users>  list= (List<Users>) utils.queryList( 
						conn, 
						"select * from crm_users"  ,   Users .class
						    ) ;
				
//				utils.endTransaction(conn);
				
			 for (int i=0;i<list.size();i++){
				 System.out.println ( list.get(i).getCreatetime()  );
			 }
			 
			*/}
		
}
